home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C++ für Kids
/
C++ for kids.iso
/
SETUP
/
US
/
CBUILDER
/
DATA.Z
/
COUNTER.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1997-02-13
|
1KB
|
26 lines
//----------------------------------------------------------------------------
//Borland C++Builder
//Copyright (c) 1987, 1997 Borland International Inc. All Rights Reserved.
//----------------------------------------------------------------------------
//-------------------------------------------------------------------------
// counter.cpp - example of a small, non-visual counter component
//-------------------------------------------------------------------------
#include "counter.h"
//-------------------------------------------------------------------------
TCounter::TCounter(int Multiple)
{
FMultiple = Multiple;
}
//-------------------------------------------------------------------------
void TCounter::Clear()
{
FVal = 0;
}
//-------------------------------------------------------------------------
void TCounter::Increment()
{
if (((++FVal) % FMultiple) == 0)
OnMultiple(this);
}
//-------------------------------------------------------------------------